package sm.dbdict.def;

public class SqlFieldOptions implements Cloneable {
	private String sql_table_alias;

	private String sql_column_name;

	private String sql_data_type;

	private Boolean sql_rc_format;

	public String getSql_table_alias() {
		return sql_table_alias;
	}

	public void setSql_table_alias(String sql_table_alias) {
		this.sql_table_alias = sql_table_alias;
	}

	public String getSql_column_name() {
		return sql_column_name;
	}

	public void setSql_column_name(String sql_column_name) {
		this.sql_column_name = sql_column_name;
	}

	public String getSql_data_type() {
		return sql_data_type;
	}

	public void setSql_data_type(String sql_data_type) {
		this.sql_data_type = sql_data_type;
	}

	public Boolean getSql_rc_format() {
		return sql_rc_format;
	}

	public void setSql_rc_format(Boolean sql_rc_format) {
		this.sql_rc_format = sql_rc_format;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((sql_column_name == null) ? 0 : sql_column_name.hashCode());
		result = prime * result
				+ ((sql_data_type == null) ? 0 : sql_data_type.hashCode());
		result = prime * result
				+ ((sql_rc_format == null) ? 0 : sql_rc_format.hashCode());
		result = prime * result
				+ ((sql_table_alias == null) ? 0 : sql_table_alias.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SqlFieldOptions other = (SqlFieldOptions) obj;
		if (sql_column_name == null) {
			if (other.sql_column_name != null)
				return false;
		} else if (!sql_column_name.equals(other.sql_column_name))
			return false;
		if (sql_data_type == null) {
			if (other.sql_data_type != null)
				return false;
		} else if (!sql_data_type.equals(other.sql_data_type))
			return false;
		if (sql_rc_format == null) {
			if (other.sql_rc_format != null)
				return false;
		} else if (!sql_rc_format.equals(other.sql_rc_format))
			return false;
		if (sql_table_alias == null) {
			if (other.sql_table_alias != null)
				return false;
		} else if (!sql_table_alias.equals(other.sql_table_alias))
			return false;
		return true;
	}

	@Override
	public Object clone() {
		try {
			SqlFieldOptions clonedObj = (SqlFieldOptions) super.clone();
			clonedObj.sql_column_name = sql_column_name;
			clonedObj.sql_data_type = sql_data_type;
			clonedObj.sql_rc_format = sql_rc_format;
			clonedObj.sql_table_alias = sql_table_alias;
			return clonedObj;
		} catch (CloneNotSupportedException e) {
			// this shouldn't happen, since we are Cloneable
			throw new InternalError();
		}
	}
}
